Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix/label_sliced_way_ends #138

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

thomas-fred
Copy link
Contributor

osm_to_pq.py clips OSM .pbf files of ways to a bounding box and converts the ways to GeoDataFrames of edges, split at junctions. It also tries to label which edges have termini (starts or ends) resulting from being clipped.

An OSM way may be split into several segments, where nodes from other ways intersect the way in question. Previously, it was assumed that any segment ending in a node that wasn't 'shared', i.e. degree >= 2, must have been clipped. In fact, this also includes dead ends and so erroneously labelled many edges as having been clipped.

This PR reworks the script, using an index of all nodes (not just shared ones) to check if a segment end is new (and therefore resulting from a clip operation). It also hopefully improves the readability (although it's still a bit hard to follow).

Fixing this is a step towards network component labeling at scale, i.e. on sections of networks, before joining the sections on the clipped boundaries later.

@thomas-fred
Copy link
Contributor Author

Should close #114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant